function [ normalized_power ] = NormalizePower( power, times )
%NORMALIZEPOWER Normalizes power using a baseline between -3s and 3s
%
%     [ NORMALIZED_POWER ] = NORMALIZEPOWER( POWER, TIMES )
%

baselineTimepoints = times>-3000 & times<3000;
baseline = mean(mean(power(:, baselineTimepoints, :), 3), 2);
normalized_power = 10*log10(power) - 10*repmat(log10(baseline),[1 length(times) size(power,3)]);

end